<!DOCTYPE html>
<html>

<head lang="zh-cn">
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>全部课程</title>
    <link rel="Shortcut Icon" href="images/logo.gif">
    <link rel="stylesheet" href="libs/bootstrap.min.css">
    <link rel="stylesheet" href="css/common.css">
</head>

<body>
    <div id="topFix">
        <strong>Admin</strong>
        <small>后台管理系统</small>
        <div class="text">
            <span>
                <i class="glyphicon glyphicon-user"></i> 你好，管理员A
            </span>
            <button class="btn btn-danger btn-sm logout">
                <i class="glyphicon glyphicon-off"></i> 退出
            </button>
        </div>
    </div>
    <div id="wrap">
        <!-- 侧边栏-->
        <div class="sidebar">
            <ul class="nav nav-pills nav-stacked" role="tablist">
                <li class="active">
                    <a href="#list1" data-toggle="collapse">课程管理</a>
                    <ol id="list1" class="nav nav-pills nav-stacked collapse in">
                        <li class="bg-info"><a href="javascript:;">全部课程</a></li>
                        <li><a href="addCourse.html">新建课程</a></li>
                    </ol>
                </li>
                <li class="active">
                    <a href="#list2" data-toggle="collapse">用户管理</a>
                    <ol id="list2" class="nav nav-pills nav-stacked collapse in">
                        <li><a href="members.html">成员信息</a></li>
                        <li><a href="newMember.html">添加用户</a></li>
                        <li><a href="departments.html">科室管理</a></li>
                    </ol>
                </li>
                <li class="active">
                    <a href="#list3" data-toggle="collapse">健康处方</a>
                    <ol id="list3" class="nav nav-pills nav-stacked collapse in">
                        <li><a href="healthContent.html">文件管理</a></li>
                        <li><a href="healthUpload.html">上传文件</a></li>
                    </ol>
                </li>
                <li class="active">
                    <a href="#list4" data-toggle="collapse" class="collapse">管理员设置</a>
                    <ol id="list4" class="nav nav-pills nav-stacked collapse in">
                        <li><a href="#">修改密码</a></li>
                    </ol>
                </li>
            </ul>
        </div>
        <!-- 正文 -->
        <div class="main">
            <!-- 路径导航 -->
            <ol class="breadcrumb">
                <li class="active">课程管理</li>
                <li class="active">全部课程</li>
            </ol>
            <table class="table table-striped table-bordered table-hover table-condensed">
                <thead>
                    <tr>
                        <th>#</th>
                        <th>课程名称</th>
                        <th>状态</th>
                        <th>发布日期</th>
                        <th>截止日期</th>
                        <th>操作</th>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <td>1</td>
                        <td>课程1</td>
                        <td><span class="label label-primary">进行中</span></td>
                        <td>2016/12/30 08:08:08</td>
                        <td>2016/12/30 08:08:08</td>
                        <td>
                            <button class="check btn btn-link btn-sm"><i class="glyphicon glyphicon-search"></i> 查看</button>
                            <button class="btn btn-link btn-sm delete"><i class="glyphicon glyphicon-trash"></i> 删除</button>
                        </td>
                    </tr>
                    <tr>
                        <td>2</td>
                        <td>课程2</td>
                        <td><span class="label label-primary">进行中</span></td>
                        <td>2016/12/30 08:08:08</td>
                        <td>2016/12/30 08:08:08</td>
                        <td>
                            <button class="check btn btn-link btn-sm"><i class="glyphicon glyphicon-search"></i> 查看</button>
                            <button class="btn btn-link btn-sm delete"><i class="glyphicon glyphicon-trash"></i> 删除</button>
                        </td>
                    </tr>
                    <tr>
                        <td>3</td>
                        <td>课程3</td>
                        <td><span class="label label-primary">进行中</span></td>
                        <td>2016/12/30 08:08:08</td>
                        <td>2016/12/30 08:08:08</td>
                        <td>
                            <button class="check btn btn-link btn-sm"><i class="glyphicon glyphicon-search"></i> 查看</button>
                            <button class="btn btn-link btn-sm delete"><i class="glyphicon glyphicon-trash"></i> 删除</button>
                        </td>
                    </tr>
                    <tr>
                        <td>4</td>
                        <td>课程N</td>
                        <td><span class="label label-primary">进行中</span></td>
                        <td>2016/12/30 08:08:08</td>
                        <td>2016/12/30 08:08:08</td>
                        <td>
                            <button class="check btn btn-link btn-sm"><i class="glyphicon glyphicon-search"></i> 查看</button>
                            <button class="btn btn-link btn-sm delete"><i class="glyphicon glyphicon-trash"></i> 删除</button>
                        </td>
                    </tr>
                    <tr>
                        <td>5</td>
                        <td>课程N</td>
                        <td><span class="label label-warning">已结束</span></td>
                        <td>2017/01/01 01:01:01</td>
                        <td>2016/12/30 08:08:08</td>
                        <td>
                            <button class="check btn btn-link btn-sm"><i class="glyphicon glyphicon-search"></i> 查看</button>
                            <button class="btn btn-link btn-sm delete"><i class="glyphicon glyphicon-trash"></i> 删除</button>
                        </td>
                    </tr>
                    <tr>
                        <td>6</td>
                        <td>课程N</td>
                        <td><span class="label label-warning">已结束</span></td>
                        <td>2017/01/01 01:01:01</td>
                        <td>2016/12/30 08:08:08</td>
                        <td>
                            <button class="check btn btn-link btn-sm"><i class="glyphicon glyphicon-search"></i> 查看</button>
                            <button class="btn btn-link btn-sm delete"><i class="glyphicon glyphicon-trash"></i> 删除</button>
                        </td>
                    </tr>
                    <tr>
                        <td>7</td>
                        <td>课程N</td>
                        <td><span class="label label-warning">已结束</span></td>
                        <td>2017/01/01 01:01:01</td>
                        <td>2016/12/30 08:08:08</td>
                        <td>
                            <button class="check btn btn-link btn-sm"><i class="glyphicon glyphicon-search"></i> 查看</button>
                            <button class="btn btn-link btn-sm delete"><i class="glyphicon glyphicon-trash"></i> 删除</button>
                        </td>
                    </tr>
                    <tr>
                        <td>8</td>
                        <td>课程N</td>
                        <td><span class="label label-warning">已结束</span></td>
                        <td>2017/01/01 01:01:01</td>
                        <td>2016/12/30 08:08:08</td>
                        <td>
                            <button class="check btn btn-link btn-sm"><i class="glyphicon glyphicon-search"></i> 查看</button>
                            <button class="btn btn-link btn-sm delete"><i class="glyphicon glyphicon-trash"></i> 删除</button>
                        </td>
                    </tr>
                    <tr>
                        <td>9</td>
                        <td>课程N</td>
                        <td><span class="label label-warning">已结束</span></td>
                        <td>2017/01/01 01:01:01</td>
                        <td>2016/12/30 08:08:08</td>
                        <td>
                            <button class="check btn btn-link btn-sm"><i class="glyphicon glyphicon-search"></i> 查看</button>
                            <button class="btn btn-link btn-sm delete"><i class="glyphicon glyphicon-trash"></i> 删除</button>
                        </td>
                    </tr>
                    <tr>
                        <td>10</td>
                        <td>课程N</td>
                        <td><span class="label label-warning">已结束</span></td>
                        <td>2017/01/01 01:01:01</td>
                        <td>2016/12/30 08:08:08</td>
                        <td>
                            <button class="check btn btn-link btn-sm"><i class="glyphicon glyphicon-search"></i> 查看</button>
                            <button class="btn btn-link btn-sm delete"><i class="glyphicon glyphicon-trash"></i> 删除</button>
                        </td>
                    </tr>
                    <tr>
                        <td>11</td>
                        <td>课程N</td>
                        <td><span class="label label-warning">已结束</span></td>
                        <td>2017/01/01 01:01:01</td>
                        <td>2016/12/30 08:08:08</td>
                        <td>
                            <button class="check btn btn-link btn-sm"><i class="glyphicon glyphicon-search"></i> 查看</button>
                            <button class="btn btn-link btn-sm delete"><i class="glyphicon glyphicon-trash"></i> 删除</button>
                        </td>
                    </tr>
                    <tr>
                        <td>12</td>
                        <td>课程N</td>
                        <td><span class="label label-warning">已结束</span></td>
                        <td>2017/01/01 01:01:01</td>
                        <td>2016/12/30 08:08:08</td>
                        <td>
                            <button class="check btn btn-link btn-sm"><i class="glyphicon glyphicon-search"></i> 查看</button>
                            <button class="btn btn-link btn-sm delete"><i class="glyphicon glyphicon-trash"></i> 删除</button>
                        </td>
                    </tr>
                    <tr>
                        <td>13</td>
                        <td>课程N</td>
                        <td><span class="label label-warning">已结束</span></td>
                        <td>2017/01/01 01:01:01</td>
                        <td>2016/12/30 08:08:08</td>
                        <td>
                            <button class="check btn btn-link btn-sm"><i class="glyphicon glyphicon-search"></i> 查看</button>
                            <button class="btn btn-link btn-sm delete"><i class="glyphicon glyphicon-trash"></i> 删除</button>
                        </td>
                    </tr>
                    <tr>
                        <td>14</td>
                        <td>课程N</td>
                        <td><span class="label label-warning">已结束</span></td>
                        <td>2017/01/01 01:01:01</td>
                        <td>2016/12/30 08:08:08</td>
                        <td>
                            <button class="check btn btn-link btn-sm"><i class="glyphicon glyphicon-search"></i> 查看</button>
                            <button class="btn btn-link btn-sm delete"><i class="glyphicon glyphicon-trash"></i> 删除</button>
                        </td>
                    </tr>
                    <tr>
                        <td>15</td>
                        <td>课程N</td>
                        <td><span class="label label-warning">已结束</span></td>
                        <td>2017/01/01 01:01:01</td>
                        <td>2016/12/30 08:08:08</td>
                        <td>
                            <button class="check btn btn-link btn-sm"><i class="glyphicon glyphicon-search"></i> 查看</button>
                            <button class="btn btn-link btn-sm delete"><i class="glyphicon glyphicon-trash"></i> 删除</button>
                        </td>
                    </tr>
                    <tr>
                        <td>16</td>
                        <td>课程N</td>
                        <td><span class="label label-warning">已结束</span></td>
                        <td>2017/01/01 01:01:01</td>
                        <td>2016/12/30 08:08:08</td>
                        <td>
                            <button class="check btn btn-link btn-sm"><i class="glyphicon glyphicon-search"></i> 查看</button>
                            <button class="btn btn-link btn-sm delete"><i class="glyphicon glyphicon-trash"></i> 删除</button>
                        </td>
                    </tr>
                    <tr>
                        <td>17</td>
                        <td>课程N</td>
                        <td><span class="label label-warning">已结束</span></td>
                        <td>2017/01/01 01:01:01</td>
                        <td>2016/12/30 08:08:08</td>
                        <td>
                            <button class="check btn btn-link btn-sm"><i class="glyphicon glyphicon-search"></i> 查看</button>
                            <button class="btn btn-link btn-sm delete"><i class="glyphicon glyphicon-trash"></i> 删除</button>
                        </td>
                    </tr>
                    <tr>
                        <td>18</td>
                        <td>课程N</td>
                        <td><span class="label label-warning">已结束</span></td>
                        <td>2017/01/01 01:01:01</td>
                        <td>2016/12/30 08:08:08</td>
                        <td>
                            <button class="check btn btn-link btn-sm"><i class="glyphicon glyphicon-search"></i> 查看</button>
                            <button class="btn btn-link btn-sm delete"><i class="glyphicon glyphicon-trash"></i> 删除</button>
                        </td>
                    </tr>
                    <tr>
                        <td>19</td>
                        <td>课程N</td>
                        <td><span class="label label-warning">已结束</span></td>
                        <td>2017/01/01 01:01:01</td>
                        <td>2016/12/30 08:08:08</td>
                        <td>
                            <button class="check btn btn-link btn-sm"><i class="glyphicon glyphicon-search"></i> 查看</button>
                            <button class="btn btn-link btn-sm delete"><i class="glyphicon glyphicon-trash"></i> 删除</button>
                        </td>
                    </tr>
                    <tr>
                        <td>20</td>
                        <td>课程N</td>
                        <td><span class="label label-warning">已结束</span></td>
                        <td>2017/01/01 01:01:01</td>
                        <td>2016/12/30 08:08:08</td>
                        <td>
                            <button class="check btn btn-link btn-sm"><i class="glyphicon glyphicon-search"></i> 查看</button>
                            <button class="btn btn-link btn-sm delete"><i class="glyphicon glyphicon-trash"></i> 删除</button>
                        </td>
                    </tr>
                </tbody>
            </table>
            <!-- 所有页码 -->
            <div class="btn-toolbar text-center">
                <div id="pagebar" class="btn-group btn-group-md"></div>
            </div>
        </div>
    </div>
    <script src="libs/jquery-2.1.4.js"></script>
    <script src="libs/bootstrap.min.js"></script>
    <script src="libs/jquery.pagination.js"></script>
    <script>
    $(function() {
        // 事件委托-查看
        $('table').on('click', '.check', function(e) {
                var nowIndex = $(".check").index(this); //当前按钮的索引

                window.location.href = 'courseProgress.html'; //跳转
                alert(nowIndex);
            }) // 事件委托-删除
            .on('click', '.delete', function() {
                var nowIndex = $(".delete").index(this); //当前按钮的索引  

                if (window.confirm("是否删除(index=" + nowIndex + ")的数据")) {
                    // ajax

                    alert("删除成功！");
                    location.reload();
                }
            });

        // 参考http://www.jq22.com/yanshi5697
        var URL = location.href; //初始值
        $('#pagebar').pagination({
            totalData: 2000, //总数据条数
            showData: 10, //每页数据条数
            current: 1, //当前页
            // jump:true,//跳转
            coping: true, //开启首页尾页
            homePage: '首页',
            endPage: '末页',
            prevContent: '上页',
            nextContent: '下页',
            callback: function(obj) {
                //添加hash值
                var index = obj.getCurrent(); //参数为当前页
                var u = URL;
                location.href = u + '#' + index;

                // ajax
                $.ajax({

                })
            }
        });

    })
    </script>
</body>

</html>
